import axios from 'axios'

export const dataApi = {
  getAllTables() {
    return axios.get('/data/tables')
  },
  getTableIndicators(tableCode) {
    return axios.get(`/data/tables/${tableCode}/indicators`)
  },
  getTableSample(tableCode) {
    return axios.get(`/data/tables/${tableCode}/sample`)
  },
  queryByQuestion(tableCode, question) {
    return axios.get('/analytics/query', {
      params: {
        tableCode,
        question
      }
    })
  }
}